<!doctype html>
<html lang="zh-CN" xml:lang="zh-CN">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
        <meta charset="UTF-8" />
        <title>
            my shop cart to agoda
        </title>
        <meta name="viewport" content="width=1226" />
        <link rel="Shortcut Icon" type="image/x-icon" href="/homeassets/index/images/favicon.ico"/>
        <meta name="description" content="agoda" />
        <meta name="keywords" content="agoda" />
        <link rel="stylesheet" href="/homeassets/index/css/base.min.css" />
        <link rel="stylesheet" type="text/css" href="/homeassets/index/css/cart.min.css"/>
        <link rel="stylesheet" href="/homeassets/index/css/index.min.css" />
        <script src="/homeassets/jquery-1.8.3.min.js">
        </script>
        <script type="text/javascript">
            var _head_over_time = (new Date()).getTime();
        </script>
    </head>
    
    <body>
       @include('home.layout.cartheader')
        <div class="page-main">
            <div class="container">
                <div class="cart-loading loading hide" id="J_cartLoading">
                    <div class="loader">
                    </div>
                </div>
                @if(empty(session('homeusername')) && empty($data))
                <div class="cart-empty" id="J_cartEmpty">
                    <h2>
                        您的购物车还是空的！
                    </h2>
                    <p class="login-desc" style="display:block">
                        登录后将显示您之前加入的商品
                    </p>
                    <a href="/home/login" class="btn btn-primary btn-login" style="display: inline-block;argin-right: 10px;" id="J_loginBtn" data-stat-id="7874490dbcbc1e60">
                        立即登录
                    </a>
                    <a href="/allgoods" style="background:#fff;color:#ff6700" class="btn btn-primary btn-shoping J_goShoping" data-stat-id="4658a7dfd89505fc">
                        马上去购物
                    </a>
                </div>
                @elseif(!empty(session('homeusername')) && empty($data))
                    <div class="cart-empty" id="J_cartEmpty">
                    <h2>
                        您的购物车还是空的！
                    </h2>
                    <a href="/allgoods" style="background:#fff;color:#ff6700" class="btn btn-primary btn-shoping J_goShoping" data-stat-id="4658a7dfd89505fc">
                        马上去购物
                    </a>
                </div>
                @else
                <div id="J_cartBox" class="">
                    <div class="cart-goods-list">
                        <div class="list-head clearfix">
                            <div class="col col-check">
                                <i class="iconfont icon-checkbox icon-checkbox-selected" id="J_selectAll">
                                    √
                                </i>
                                全选
                            </div>
                            <div class="col col-img">
                                &nbsp;
                            </div>
                            <div class="col col-name">
                                商品名称
                            </div>
                            <div class="col col-price">
                                单价
                            </div>
                            <div class="col col-num">
                                数量
                            </div>
                            <div class="col col-total">
                                小计
                            </div>
                            <div class="col col-action">
                                操作
                            </div>
                        </div>
                        <div class="list-body" id="J_cartListBody">
                        @foreach($data as $k => $v)
                            <div class="item-box">
                                <div class="item-table J_cartGoods" data-info="{ commodity_id:'1170300011', gettype:'buy', itemid:'2170300007_0_buy', num:'1'} ">
                                    <div class="item-row clearfix">
                                        <div class="col col-check">
                                            <i class="iconfont icon-checkbox @if($v['status']==1) icon-checkbox-selected @endif J_itemCheckbox" data-itemid="2170300007_0_buy" data-status="1">
                                                √
                                            </i>
                                        </div>
                                        <div class="col col-img">
                                            <a href="/goodsdetail/{{ $v['gid'] }}" target="_blank">
                                                <img alt="" src="{{ $v['picture'] }}"
                                                width="80" height="80">
                                            </a>
                                        </div>
                                        <div class="col col-name">
                                            <div class="tags">
                                            </div>
                                            <h3 class="name">
                                                <a href="/goodsdetail/{{ $v['gid'] }}" target="_blank">
                                                    {{ $v['goodsname'] }}
                                                </a>
                                            </h3>
                                        </div>
                                        <div class="col col-price">
                                            <span>
                                                {{ $v['price'] }}
                                            </span>
                                            元
                                        </div>
                                        <div class="col col-num">
                                            <div class="change-goods-num clearfix J_changeGoodsNum">
                                                <a href="javascript:void(0)" class="J_minus">
                                                    <i class="iconfont">
                                                        -
                                                    </i>
                                                </a>
                                                <input tyep="text" onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else if(this.value == ''){this.value=1}else{this.value=this.value.replace(/\D/g,'')} " onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')} " name="2170300007_0_buy" value="{{ $v['count'] }}" data-num="1" data-buylimit="2" autocomplete="off" class="goods-num J_goodsNum"  info="{{ $v['id'] }}">
                                                <a href="javascript:void(0)" class="J_plus">
                                                    <i class="iconfont">
                                                        +
                                                    </i>
                                                </a>
                                            </div>
                                        </div>
                                        <div class="col col-total">
                                            <span>
                                                {{ $v['count']*$v['price']}}
                                            </span>
                                            元
                                            <p class="pre-info">
                                            </p>
                                        </div>
                                        <div class="col col-action">
                                            <a id="2170300007_0_buy" href="/home/shopcart/delete?id={{ $v['id'] }}" title="删除" onclick="return confirm('确定删除吗？')" class="del">
                                                <i class="iconfont">
                                                    X
                                                </i>
                                            </a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            @endforeach
                        </div>
                    </div>
                    <!-- 加价购 -->
                    <div class="cart-bar clearfix cart-bar-fixed" id="J_cartBar">
                        <div class="section-left">
                            <a href="/allgoods" class="back-shopping J_goShoping" data-stat-id="3d1e5bdd191768c8"
                            >
                                继续购物
                            </a>
                            <span class="cart-total">
                                共
                                <i id="J_cartTotalNum">
                                    {{ $num }}
                                </i>
                                件商品，已选择
                                <i id="J_selTotalNum">
                                    
                                </i>
                                件
                            </span>
                        </div>
                        <span class="total-price">
                            合计（不含运费）：
                            <em id="J_cartTotalPrice">
                                
                            </em>
                            元
                        </span>
                        <a href="javascript:void(0);" class="btn btn-a btn btn-primary" id="J_goCheckout" data-stat-id="f975aeb3e19f0f37">
                            去结算
                        </a>
                        <div class="no-select-tip hide" id="J_noSelectTip">
                            请勾选需要结算的商品
                            <i class="arrow arrow-a">
                            </i>
                            <i class="arrow arrow-b">
                            </i>
                        </div>
                    </div>
                </div>
                @endif
                <div class="cart-recommend hide" id="J_historyRecommend">
                </div>
                <div class="cart-recommend" id="J_miHistoryBox">
                </div>
            </div>
        </div>
        <script src="/homeassets/homepage/cartjs/cart.js"></script>
        <script src="/homeassets/index/js/layout.js"></script> 
    </body>

</html>